/*
 * Copyright (c) 2009 Nokia Corporation.
 */

#ifndef QBaseWidget_h
#define QBaseWidget_h

#include <QWidget>
#include <QStackedWidget>

#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>

// ---------------------------------------------------------------------------
// QBaseWidget: base class of all widgets (similar to Avkon View Base class)
//----------------------------------------------------------------------------

// Id to identify each widget, similar to View Id in S60
typedef uint TWidgetId;

class QBaseWidget : public QWidget
	{
Q_OBJECT

public:
	QBaseWidget(QStackedWidget* stackedWidget, QWidget *parent = 0);
	virtual ~QBaseWidget();

public:
	// Activates new view. 
	virtual void ActivateWidget();

	// Activates existing view
	virtual void DeActivateWidget();

	//pure virtual functions whih derived widgets must implement
	//to do necessary allocation & cleanup
	virtual void DoActivateWidget()=0;
	virtual void DoDeActivateWidget()=0;
	virtual TWidgetId Id() const =0;

protected:
	// Pointer to QStackedWidget where all views exists
	// This is the parent
	QStackedWidget* stackedWidget;
	};

// ---------------------------------------------------------------------------
// Derived Widgets: Concrete implementation of Base widgets
//----------------------------------------------------------------------------

// UID of view
const TWidgetId KViewId3 =
	{
	3
	};
class QMyWidget3 : public QBaseWidget
	{
Q_OBJECT

public:
	QMyWidget3(QStackedWidget* stackedWidget, QWidget *parent = 0);
	~QMyWidget3();

	// base class virtual functions that need to be implemented
	void DoActivateWidget();
	void DoDeActivateWidget();
	TWidgetId Id() const;

private:
	QVBoxLayout *slideWidget1layout;
	QWidget *slideWidget1;
	QPushButton *b11;
	QPushButton *b12;

	};

// UID of view
const TWidgetId KViewId4 =
	{
	4
	};
class QMyWidget4 : public QBaseWidget
	{
Q_OBJECT

public:
	QMyWidget4(QStackedWidget* stackedWidget, QWidget *parent = 0);
	~QMyWidget4();

	// base class virtual functions that need to be implemented
	void DoActivateWidget();
	void DoDeActivateWidget();
	TWidgetId Id() const;

private:

	QVBoxLayout *slideWidget2layout;
	QWidget *slideWidget2;
	QPushButton *b21;
	QPushButton *b22;

	};

// UID of view
const TWidgetId KViewId5 =
	{
	5
	};
class QMyWidget5 : public QBaseWidget
	{
Q_OBJECT

public:
	QMyWidget5(QStackedWidget* stackedWidget, QWidget *parent = 0);
	~QMyWidget5();

	// base class virtual functions that need to be implemented
	void DoActivateWidget();
	void DoDeActivateWidget();
	TWidgetId Id() const;

private:

	QVBoxLayout *slideWidget3layout;
	QWidget *slideWidget3;
	QPushButton *b31;
	QPushButton *b32;

	};
// UID of view
const TWidgetId KViewId6 =
	{
	6
	};
class QMyWidget6 : public QBaseWidget
	{
Q_OBJECT

public:
	QMyWidget6(QStackedWidget* stackedWidget, QWidget *parent = 0);
	~QMyWidget6();

	// base class virtual functions that need to be implemented
	void DoActivateWidget();
	void DoDeActivateWidget();
	TWidgetId Id() const;

private:

	QVBoxLayout *slideWidget4layout;
	QWidget *slideWidget4;
	QPushButton *b41;
	QPushButton *b42;

	};
#endif // QBaseWidget_h
